'''
Author: your name
Date: 2021-03-17 11:20:06
LastEditTime: 2021-05-13 16:47:09
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath: /tinyms/tinyms-api/apps/auth/test/menuDto.py
MenuDto 为前端显示类型
Menu 为数据库中的字段类型
subMenus 为菜单的子菜单集合
'''
from .model import Menu
class MenuDto():
    def __init__(self, Menu, subs):
        super().__init__()
        if Menu is not None:
            self.menu_pk = Menu.menu_pk
            self.menu_name = Menu.menu_name
            self.menu_url = Menu.menu_url
            self.menu_icon = Menu.menu_icon
            self.menu_parent = Menu.menu_parent 
            self.menu_status = Menu.menu_status 
            self.menu_number = Menu.menu_number 
            self.menu_type = Menu.menu_type 
            self.sys_type = Menu.sys_type 
        elif subs is not None:
            self.children = subs

    def __str__(self):
        return '%s(menu_pk=%s,menu_name=%s,menu_url=%s,menu_type=%s,menu_parent=%s)' % (
            self.__class__.__name__, self.menu_pk, self.menu_name, self.menu_url, self.menu_type, self.menu_parent)

    __repr = __str__